package method;

public class P6_recursion {
    /*
    递归调用
     */
    public static void main(String[] args) {
        int num = 3;
        System.out.println(num + "的阶乘是：" + f(num));

    }

    public static int f(int n){
        if (n==1){
            return 1;
        }
        else{
            return n*f(n-1);
        }
    }

}
